import os

def checkIsNotNone(input):
    return (input is not None) and (input != "") and (input != "<empty>") and (input != "None")

class CanTrcv1145RuleUtils():

    def __init__(self) -> None:
        self.log = ""
        self.ecu_cfg = None

    def validate_utils_get_CanTrcvSpiSequenceAccess_cfgs(self, config_dict: dict) -> dict:
        allchnl_CanTrcvSpiSequenceAccess_dict = {}
        cantrcv1145_configset = config_dict["CanTrcvConfigSet"]
        for key, value in cantrcv1145_configset.items():
            if key == "DefinitionRef":
                continue

            if value["DefinitionRef"] == "/AUTOSAR/EcucDefs/CanTrcv1145/CanTrcvConfigSet/CanTrcvChannel":
                chnlName = key
                chnlAttr = value
                spiSeq_list = []
                for key1, value1 in chnlAttr["CanTrcvAccess"]["CanTrcvSpiSequence"].items():
                    if key1 == "DefinitionRef":
                        continue

                    if value1["DefinitionRef"] == "/AUTOSAR/EcucDefs/CanTrcv1145/CanTrcvConfigSet/CanTrcvChannel/CanTrcvAccess/CanTrcvSpiSequence/CanTrcvSpiSequenceAccess":
                        spiSeq_list.append(key1)

                    allchnl_CanTrcvSpiSequenceAccess_dict[chnlName] = spiSeq_list
        return allchnl_CanTrcvSpiSequenceAccess_dict